﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;
using Campus.Entities;

namespace CampusSite.Models
{

    public class ChangePasswordModel
    {
        [Required(ErrorMessage = "La {0} es requerida")]
        [DataType(DataType.Password)]
        [Display(Name = "Clave actual")]
        public string OldPassword { get; set; }

        [Required(ErrorMessage = "La {0} es requerida")]
        [StringLength(100, ErrorMessage = "La {0} debe tener al menos {2} caracteres.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Nueva clave")]
        public string NewPassword { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirme la nueva clave")]
        [Compare("NewPassword", ErrorMessage = "Las claves no son iguales.")]
        public string ConfirmPassword { get; set; }
    }

    public class LogOnModel
    {
        [Required(ErrorMessage = "El {0} es requerido")]
        [Display(Name = "Usuario / Mail")]
        public string UserName { get; set; }

        [Required(ErrorMessage = "La {0} es requerida")]
        [DataType(DataType.Password)]
        [Display(Name = "Clave")]
        public string Password { get; set; }

        [Display(Name = "Recordame?")]
        public bool RememberMe { get; set; }        
    }

    public class RegisterModel
    {
        [Required(ErrorMessage = "El {0} es requerido")]        
        [Display(Name = "Usuario / Mail")]
        [Campus.Entities.EmailAttribute(ErrorMessage="Ingrese un mail valido")]
        public string UserName { get; set; }

        [Required(ErrorMessage = "El {0} es requerido")]        
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Confirme su Usuario / Mail")]
        [Compare("UserName", ErrorMessage = "El nombre de usuario y el mail deben ser iguales")]
        public string Email { get; set; }

        [Required(ErrorMessage = "La {0} es requerida")]
        [StringLength(100, ErrorMessage = "La {0} debe tener al menos {2} caracteres.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "Clave")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirme la clave")]
        [Compare("Password", ErrorMessage = "Las claves no son iguales.")]
        public string ConfirmPassword { get; set; }
        
    }
}
